<?php
// +----------------------------------------------------------------------
// | ThinkPHP [ WE CAN DO IT JUST THINK ]
// +----------------------------------------------------------------------
// | Copyright (c) 2006~2018 http://thinkphp.cn All rights reserved.
// +----------------------------------------------------------------------
// | Licensed ( http://www.apache.org/licenses/LICENSE-2.0 )
// +----------------------------------------------------------------------
// | Author: liu21st <liu21st@gmail.com>
// +----------------------------------------------------------------------
use app\middleware\Login;
use think\facade\Route;


Route::group(function () {
	Route::miss(function() {
		return '404 Not Found!';
	});
	Route::post('Login','User/login');
	Route::get('Banner','Index/banner');
	Route::get('Message','Index/message');
	Route::get('MessageDetail','Index/messageDetail');
	Route::post('Sms/send', 'Sms/send');
	Route::any('/','Index/index');
	Route::any('Notify/returnNotify','Notify/returnNotify'); //支付回调
	
	Route::group('Goods',function () {
		Route::get('class', 'Goods/class');
		Route::get('classDetail', 'Goods/classDetail');
		Route::get('/', 'Goods/index');
		Route::get('search', 'Goods/search');
		Route::get('list', 'Goods/list');
	});
	Route::group('Puddle',function () {
		Route::get('/', 'Puddle/index');
		Route::get('profile', 'Puddle/profile');
	});
	
	Route::group('PointGoods',function () {
		Route::get('class', 'PointGoods/class');
		Route::get('classDetail', 'PointGoods/classDetail');
		Route::get('list', 'PointGoods/list');
		
	});
	#需要登陆
	Route::group(function () {
		Route::group('Goods',function () {
		
			Route::get('detail', 'Goods/detail');
			Route::get('assessList', 'Goods/assessList');
			Route::post('collect', 'Goods/collect');
			Route::post('receiveCoupon', 'Goods/receiveCoupon');
			Route::get('checkCoupon', 'Goods/checkCoupon');
			Route::get('getPrice', 'Goods/getPrice');
			Route::post('createOrder', 'Goods/createOrder');
			Route::post('shopcarAdd', 'Goods/shopcarAdd');
			Route::get('shopcarList', 'Goods/shopcarList');
			Route::post('shopcarEdit', 'Goods/shopcarEdit');
			Route::post('shopcarDelete', 'Goods/shopcarDelete');
			Route::get('shopcarCheckCoupon', 'Goods/shopcarCheckCoupon');
			Route::get('shopcarGetPrice', 'Goods/shopcarGetPrice');
			Route::post('shopcarCreateOrder', 'Goods/shopcarCreateOrder');
			Route::get('orderList', 'Goods/orderList');
			Route::get('adminOrderList', 'Goods/adminOrderList');
			Route::get('orderDetail', 'Goods/orderDetail');
			Route::get('orderDetailList', 'Goods/orderDetailList');
			Route::post('orderCancel', 'Goods/orderCancel');
			Route::post('orderDelete', 'Goods/orderDelete');
			Route::post('adminOrderDelete', 'Goods/adminOrderDelete');
			Route::post('orderPay', 'Goods/orderPay');
			Route::post('orderConfirm', 'Goods/orderConfirm');
			Route::post('adminOrderConfirm', 'Goods/adminOrderConfirm');
			Route::post('orderAssess', 'Goods/orderAssess');
		});
		
		Route::group('User',function () {
			Route::get('getUserInfo', 'User/getUserInfo');
			Route::post('userEdit', 'User/userEdit');
			Route::post('bindMobile', 'User/bindMobile');
			Route::get('userScore', 'User/userScore');
			Route::get('userMoney', 'User/userMoney');
			Route::get('couponList', 'User/couponList');
			Route::get('getQRCode', 'User/getQRCode');
			Route::get('collectList', 'User/collectList');
			Route::get('footList', 'User/footList');
			Route::post('footClear', 'User/footClear');
			Route::get('todayData', 'User/todayData');
		});
		
		Route::group('PointGoods',function () {
		
			Route::get('orderDetailList', 'Goods/orderDetailList');
			Route::get('detail', 'PointGoods/detail');
			Route::get('assessList', 'PointGoods/assessList');
			Route::get('getPrice', 'PointGoods/getPrice');
			Route::post('createOrder', 'PointGoods/createOrder');
			Route::get('orderList', 'PointGoods/orderList');
			Route::get('adminOrderList', 'PointGoods/adminOrderList');
			Route::get('orderDetail', 'PointGoods/orderDetail');
			Route::post('orderDelete', 'PointGoods/orderDelete');
			Route::post('adminOrderDelete', 'PointGoods/adminOrderDelete');
			Route::post('orderConfirm', 'PointGoods/orderConfirm');
			Route::post('adminOrderConfirm', 'PointGoods/adminOrderConfirm');
			Route::post('orderAssess', 'PointGoods/orderAssess');
		});
		
		Route::group('Puddle',function () {
	
			Route::get('detail', 'Puddle/detail');
			Route::post('createOrder', 'Puddle/createOrder');
			Route::get('vipPuddle', 'Puddle/vipPuddle');
			Route::get('orderList', 'Puddle/orderList');
			Route::get('orderDetail', 'Puddle/orderDetail');
		
		});
		
		Route::group('TakeDelivery',function () {
			Route::get('list', 'TakeDelivery/list');
			Route::post('addTakeDelivery', 'TakeDelivery/addTakeDelivery');
			Route::post('setDefaultTakeDelivery', 'TakeDelivery/setDefaultTakeDelivery');
			Route::post('deleteTakeDelivery', 'TakeDelivery/deleteTakeDelivery');
			Route::post('editTakeDelivery', 'TakeDelivery/editTakeDelivery');
			Route::get('getDefaultTakeDelivery', 'TakeDelivery/getDefaultTakeDelivery');
			Route::get('getTakeDelivery', 'TakeDelivery/getTakeDelivery');
		});
		
		Route::group('Bank',function () {
			Route::get('bank', 'Bank/bank');
			Route::get('getWithdrawConfig', 'Bank/getWithdrawConfig');
			Route::post('addBank', 'Bank/addBank');
			Route::post('deleteBank', 'Bank/deleteBank');
			Route::post('withdraw', 'Bank/withdraw');
			Route::get('withdrawList', 'Bank/withdrawList');
			Route::get('bankList', 'Bank/bankList');
		});
		
		Route::group('Vip',function () {
			Route::get('/', 'Vip/index');
			Route::post('createOrder', 'Vip/createOrder');
			Route::post('choose', 'Vip/choose');
			Route::get('getQrCode', 'Vip/getQrCode');
			Route::get('detail', 'Vip/detail');
			Route::get('qrCodeDetail', 'Vip/qrCodeDetail');
			Route::post('qrCodeOff', 'Vip/qrCodeOff');
		});
		
		Route::group('Config',function () {
			Route::get('getPrivacyPolicy', 'config/getPrivacyPolicy');
			Route::get('getUserAgreement', 'config/getUserAgreement');
			Route::get('getVipAgreement', 'config/getVipAgreement');
		});
	
		
		Route::post('Logout', 'user/logout');
		
	})->middleware(Login::class);
	
	
	

	
})->middleware(\app\middleware\Auth::class)->allowCrossDomain();

